/**
 * 
 */
package domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * @author yfekih
 *
 */

@Embeddable
public class DroneMissionPK implements Serializable{
	
	public DroneMissionPK(){
		
	}

	public DroneMissionPK(Long missionId, Long droneId) {
		this.missionId = missionId;
		this.droneId = droneId;
	}

	/**
	 * 
	 */
	private static final long serialVersionUID = 5552241291436865585L;

	@Column(name = "MISSION_ID", nullable = false)
	private Long missionId;
	
	@Column(name = "DRONE_ID", nullable = false)
	private Long droneId;

	
	
	public Long getMissionId() {
		return missionId;
	}

	public void setMissionId(Long missionId) {
		this.missionId = missionId;
	}

	public Long getDroneId() {
		return droneId;
	}

	public void setDroneId(Long droneId) {
		this.droneId = droneId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((droneId == null) ? 0 : droneId.hashCode());
		result = prime * result
				+ ((missionId == null) ? 0 : missionId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DroneMissionPK other = (DroneMissionPK) obj;
		if (droneId == null) {
			if (other.droneId != null)
				return false;
		} else if (!droneId.equals(other.droneId))
			return false;
		if (missionId == null) {
			if (other.missionId != null)
				return false;
		} else if (!missionId.equals(other.missionId))
			return false;
		return true;
	}

	
}
